/**
 * 跑马灯
 * @param elem
 * @param interval
 * @param time
 * @return
 */
plugor.Marquee = function(elem,interval,time){
	this.elem = elem;
	this.interval = interval;
	this.time = time;
	return this;
}


plugor.Marquee.prototype = {
	w:function(w){
		var c,_this = this;
		with(_this.elem){
			innerHTML+=innerHTML;
			onmouseover = function(){c=1};
			onmouseout = function(){c=0};
		}
		var _scroll;
		(_scroll = function(){
			if(_this.elem.scrollLeft%w||!c){
				_this.elem.scrollLeft++,_this.elem.scrollLeft%=_this.elem.scrollWidth>>1;
			}
			setTimeout(_scroll,_this.elem.scrollLeft%w?_this.interval:_this.time);
		})();
	},
	h:function(h){
		var c,_this = this;
		with(_this.elem){
			innerHTML+=innerHTML;
			onmouseover = function(){c=1};
			onmouseout = function(){c=0};
		}
		var _scroll;
		(_scroll = function(){
			if(_this.elem.scrollTop%h||!c){
				_this.elem.scrollTop++,_this.elem.scrollTop%=_this.elem.scrollHeight>>1;
			}
			setTimeout(_scroll,_this.elem.scrollTop%h?_this.interval:_this.time);
		})();
	}
}
